<?php
class LoginController extends Controller{
	private $db;//模型对象
	public function __init(){
		$this->db=new AdminModel;
	}
	// 登录
	public function login(){
		if(IS_POST){
			if($this->db->userLogin($_POST)){
				$this->success('登陆成功',__MODULE__);
			}else{
				$this->error($this->db->error);
			}
		}else{
			$this->display('login.html');
		}
	}
	// 退出
	public function out(){
		session_unset();
		session_destroy();
		$this->success('退出成功',__CONTROLLER__.'&a=login');
	}
}



?>